<%@include file="cabecera.jsp"%>
<%@page import="java.util.ArrayList,java.util.Collection,javaroke.modelo.Sala,javaroke.negocio.GestionSala"%>

<meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">
  
    <title>Bootstrap, from Twitter</title>

    <script src="js/jquery-1.10.2.js"></script>
    <script src="js/jquery-ui-1.10.3.js"></script>
    <script src="js/bootstrap.js"></script>
    
    <!-- Le styles -->
    <link href="css/bootstrap.css" rel="stylesheet">    
    <link href="css/bootstrap-responsive.css" rel="stylesheet">
    <link href="css/bootswatch.css" rel="stylesheet">
    <link href="css/jquery-ui-1.10.3.css" rel="stylesheet">
  

    <!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
    <!--[if lt IE 9]>
      <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->

<script type="text/javascript">
	function validateForm()	{
	var x=document.forms["frmRegComentario"]["txtComentario"].value;
	if (x==null || x=="")
	  {
		alert("Ingrese Comentario") ;
	  	  return false;
	  }

		}
</script>

<p><strong>Mantenimiento de Salas &gt; Registrar Comentarios</strong></p>

	<form id="form1" name="frmRegComentario" onsubmit="return validateForm()"  method="post" action="RegistrarComentarioServlet">
	  <table width="780" height="230" border="0">
	    <tr>
	      <td width="160">&nbsp;</td>
	      <td width="610">&nbsp;</td>
        </tr>  
	    
	    <tr>
	      <td><em>Sala:</em></td>
	      <td>
	          <%
	          	GestionSala negocio = new GestionSala();		
		        Collection<Sala> todos = negocio.listar();	          
		        request.setAttribute("ListadoSalas",todos);
	          %>
			  <select name="cboSala" style = "width:300px">
				<%	
					String tipo = " ";
					for(Sala c:todos){
						if(!tipo.equals(c.getNombre() ))  {
							out.println("<option value="+ c.getIdsala()+">"+c.getNombre() +"</option>");
						}
						tipo = c.getNombre();				 
					}
				%>
			 </select>			
          </td>
        </tr>
        
	    <tr>
	      <td><em>Calificacion:</em></td>
	      <td>
	         <select name="cboCalifica" style = "width:100px">
				<%	
					String Lcal = " ";
				    String Tpcal= " ";
				    for(int ind=1; ind <= 5; ind++){
				    	Tpcal+= "*";
						out.println("<option value=" + Tpcal + ">" + Tpcal +"</option>");									 
					}
				%>
			 </select>
          </td>
        </tr>
	    <tr>
	      <td><em>Comentario:</em></td>
	      <td>
               <textarea name = txtComentario id=txtComentario rows="10" cols="35"></textarea>
          </td>
        </tr>
	    <tr>
	      <td>&nbsp;</td>
	      <td>&nbsp;</td>
        </tr>
	    <tr>
	      
	      <td>
       		  <input type="button" name="button" id="btnCancelar" value="Cancelar" onclick="window.location = 'Comentarios.jsp'" />	      
          </td>
	      <td>
	          <input type="submit" name="button" id="btnGuardar" value="Grabar" />
	      </td>
	      
        </tr>
      </table>
	</form>
	

<%@include file="pie.jsp"%>